package com.bdqn.controller;

import com.bdqn.base.R;
import com.bdqn.base.logger.WebLogger;
import com.bdqn.feign.IProductService;
import com.bdqn.pojo.Product;
import com.bdqn.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 订单
 *
 * @author lilibo
 * @date 2021/10/01
 */
@Api(tags = "订单接口")
@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private IProductService productService;

    @Resource
    private OrderService orderService;

    /**
     * 测试
     *
     * @param id
     * @return R
     */
    @ApiOperation("测试服务远程调用")
    @WebLogger("测试服务远程调用")
    @GetMapping("/test/{id}")
    public R<Product> testOrder(@ApiParam("ID") @PathVariable Integer id) {
        // 像调用本地服务一样调用远程服务
        return productService.testProduct(id);
    }

}
